UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TPV/gHuQ1e4L/D1bekN/JmNyuWHy80TJ04dmCregmDU=' 
WHERE 
  key_id = '281e4625c033921be523a30f4a620ea79e0b4012d23d0988800a93688a8b2eb2' 
  AND (
    token = 'TPV/gHuQ1e4L/D1bekN/JmNyuWHy80TJ04dmCregmDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054