UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xLoJEa8KAKSOV7tJJ2EIvY4wrRBYs2ddbH92qBqit8=' 
WHERE 
  key_id = '26f66cfdcd982c8a44d6e367f3cbb6595d244be23b0d0d1322f4b502d50c7159' 
  AND (
    token = '8xLoJEa8KAKSOV7tJJ2EIvY4wrRBYs2ddbH92qBqit8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051