UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/aFv7H4W4EkJODzEyaw5GiOQs+g9/R106Y3NTZKKjVs='
WHERE
key_id = 'cea1337a1ef99883599c0972438cd06da47fc12899eddd59cddcc206f9f43c3a'
AND (
token = '/aFv7H4W4EkJODzEyaw5GiOQs+g9/R106Y3NTZKKjVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)