UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BITvxJuabRxovg/gIoLwX3Bu0iaczdPhDKi/r/eRXLs='
WHERE
key_id = '71bdfb86e2336bbd287528e520ae877229eba36fea358b31d03dc71536ed6bb8'
AND (
token = 'BITvxJuabRxovg/gIoLwX3Bu0iaczdPhDKi/r/eRXLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)