UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qpq+t884Es6eO6OiefgwswkISXbvmM1/Z2nAmRn1GeY='
WHERE
key_id = '24425dd8f8dba9f46eb66a7da73c4ab145f5aaedba644fcd914604c37c0f6057'
AND (
token = 'Qpq+t884Es6eO6OiefgwswkISXbvmM1/Z2nAmRn1GeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)