UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zTtjtZ4uYX3/JkfZG00TUFzxFktvyLcjaWEp8E7QSMk='
WHERE
key_id = '14ad523fafbd4c174c23c1bf1a96e3003c3ccd3bb97a8acae77943af938a789b'
AND (
token = 'zTtjtZ4uYX3/JkfZG00TUFzxFktvyLcjaWEp8E7QSMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)