UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B8zwiAFOmkALNYl+oZL88/fu+CGaxzHi6HyGMB7JkeQ='
WHERE
key_id = 'c4f0db26f50f6684dcbc02239cadcb0e8b85472ef9c1827d18d412099c8e70c5'
AND (
token = 'B8zwiAFOmkALNYl+oZL88/fu+CGaxzHi6HyGMB7JkeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)