UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vXqeOAPRAByA/P8UmIiC7w05tt6a3ZDB13EVfSNsy4Q='
WHERE
key_id = '183f8523a7f3612ab2f80da37c222189ff3210810d4f7d7d1a009d923ea6f0e6'
AND (
token = 'vXqeOAPRAByA/P8UmIiC7w05tt6a3ZDB13EVfSNsy4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)