UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7UuQ6SC5Q+dkk2DcM6SuZyBjNagbRWD8b0gPh5w2AI='
WHERE
key_id = '186bf19d79cb5c091b09ce679512d8356f0f88a42c1361e7b648b808127fb96a'
AND (
token = 'A7UuQ6SC5Q+dkk2DcM6SuZyBjNagbRWD8b0gPh5w2AI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)