UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sf+9ADrqrmUbh8rsycSPHYaHG56tRqx2wrAPrEtBx1U='
WHERE
key_id = '77e9458bb0a520284fd09e4f1fde4a2d883712c710d54857d2b529e8800ada15'
AND (
token = 'sf+9ADrqrmUbh8rsycSPHYaHG56tRqx2wrAPrEtBx1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)