UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NnGyqD73CDQaRR/0J3PYi6mQCbN0YlSQN7O7EMPfJk='
WHERE
key_id = '034af6c4db8124d4a2060c76502412d7d1d6e7d7a7b7fdfac74cdc867c1f8150'
AND (
token = '4NnGyqD73CDQaRR/0J3PYi6mQCbN0YlSQN7O7EMPfJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)