UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WAZJUbJmrWMxGW3T9lhULRa1Q1G/CVX1lqcE0PRLGKE='
WHERE
key_id = 'fdf2270ce6d071f25d9ee4a742dafdb85dd14143abbb042e24c35e3bc461a37c'
AND (
token = 'WAZJUbJmrWMxGW3T9lhULRa1Q1G/CVX1lqcE0PRLGKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)