UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'orm4R71KW+xBk2qgRj2qGmyyn3JzuJClYV0yS6IVe5Y='
WHERE
key_id = 'da883b2657ce96d1a8962936d9c5b4f93868d5f2436c9da4e87667ea317f48f1'
AND (
token = 'orm4R71KW+xBk2qgRj2qGmyyn3JzuJClYV0yS6IVe5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)