UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DnJMFlZsODTzcwdbGokk97KdOBzKBPw7PTA7IjCsK9M='
WHERE
key_id = '3df622ac23a2f5a7ad8d173ddf5bdf0bf4cb7ddad5541bbba0262862b82c56e6'
AND (
token = 'DnJMFlZsODTzcwdbGokk97KdOBzKBPw7PTA7IjCsK9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)