UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TTp/P9e2U4KNzUBLjXQFLY23xxY3Loi2kpeQwSwZKI8='
WHERE
key_id = 'ff6fea40ddda715f0d7dba4011492e283436fb888cb83e6b1a55d05b8509f21c'
AND (
token = 'TTp/P9e2U4KNzUBLjXQFLY23xxY3Loi2kpeQwSwZKI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)