UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zEfwMKWqt0PVuZJ4zV9wwz/P55ci+G3My+qeOWOrrSE='
WHERE
key_id = '20784cf61141ca0661e75f3719ce0e32b994472c1d03ab943181b1a3d4db2b96'
AND (
token = 'zEfwMKWqt0PVuZJ4zV9wwz/P55ci+G3My+qeOWOrrSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)