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