UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YlaM3XXwDEU96+59GLD0J7ytKGEhmZsQkFc7Sk28ETs='
WHERE
key_id = '1e8a5c79663d588dad2e3ff30effc5fd17b826277fc7815554d58fbe349bdbd2'
AND (
token = 'YlaM3XXwDEU96+59GLD0J7ytKGEhmZsQkFc7Sk28ETs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)