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