UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yKUowUyrKf7hcl/99EloLfwT7++eigTWgc22rBMKzL8='
WHERE
key_id = '10fbd5b2f498e2d0e693da52da3ec0e2433232ed82625bd72f14a28aefe8911d'
AND (
token = 'yKUowUyrKf7hcl/99EloLfwT7++eigTWgc22rBMKzL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)