UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5/BYyRy3NzyPcuAbqTU9IOQQ/tXz6xVGDLvbZpDXUrE='
WHERE
key_id = 'be3c7cf9fc3dde86b4a6cac8abd8cd76a0de4a4bc6454b8249acb27961149c38'
AND (
token = '5/BYyRy3NzyPcuAbqTU9IOQQ/tXz6xVGDLvbZpDXUrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)