UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zDfaJrGjx1VzAK0pN4f1ADi90/ab5dL/awMEy/9Wv9c='
WHERE
key_id = '5abc6bc0ee7b9d5d205f67672a469510e0b5fedd6e56bf3358b30f564c84d5f7'
AND (
token = 'zDfaJrGjx1VzAK0pN4f1ADi90/ab5dL/awMEy/9Wv9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)