UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VlWBGB/SqsATFDQ9uI53rd5gjRCrcONz0R8q2X1glyY='
WHERE
key_id = '0dd1da99a527a3b670894a5fa3cd3bc8fe2f0a8c706abaaf12ef89e53b905c0d'
AND (
token = 'VlWBGB/SqsATFDQ9uI53rd5gjRCrcONz0R8q2X1glyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)