UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H3hOucP+uqSrnv+pxrvqZMMdSwVUBqaoVwSi9EuZLJQ='
WHERE
key_id = '13bd59ad890217b16c61dced0b8a08e4ed1d53b1a98148267fd7ce572c3b4df6'
AND (
token = 'H3hOucP+uqSrnv+pxrvqZMMdSwVUBqaoVwSi9EuZLJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)