UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UZlm0Zsz2BFLngWsQRjKsEzyOstzSTMARPP9mpWN6rs='
WHERE
key_id = 'e207cfca5e861ba5288c7b57d90334705ad3dc41d68ed852d30d443d14baf3fd'
AND (
token = 'UZlm0Zsz2BFLngWsQRjKsEzyOstzSTMARPP9mpWN6rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)