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