UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a1jt5c+LkzoB1NCWknIbhTxn6zYm0rPNBWjQSCr0Keg='
WHERE
key_id = 'c207fc784a0412e1cf2d55af7ba01a470232330c7f0707d996c1a70c2f908d3a'
AND (
token = 'a1jt5c+LkzoB1NCWknIbhTxn6zYm0rPNBWjQSCr0Keg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)