UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'miFWOx8uEp9wejaYC1vyzWePYuX9ewPxf+teTG/QvQw='
WHERE
key_id = '0986bcfb39771a2976c57dc7c8559a47f57fe9f8bc4e725aed6f59a88d098b85'
AND (
token = 'miFWOx8uEp9wejaYC1vyzWePYuX9ewPxf+teTG/QvQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)