UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T2i7B0m556IqVC2cqqomK2bwiDFgE+9QwRoLOiyUdLE='
WHERE
key_id = '573e8cd08dd8d31f7f642aa6b72a0dcb268001858bebeafefa131d9ea2d59337'
AND (
token = 'T2i7B0m556IqVC2cqqomK2bwiDFgE+9QwRoLOiyUdLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)