UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qplDQiYQu7Nb5wGZb8V7NMNPLpCKF7dEgaiNq3jiAWg=' 
WHERE 
  key_id = 'a98efd7281df86a9cf6c9d2e8b489c51ee30ee7b507fe600a258e4b43381046e' 
  AND (
    token = 'qplDQiYQu7Nb5wGZb8V7NMNPLpCKF7dEgaiNq3jiAWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027