UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bJhoFSQoxLDWS/WLU0HFAQCW+G0Q2R/Q8crCVXW+KOk=' 
WHERE 
  key_id = '5c8ccf6c2c6d9688c1370940c709fdea081b5bc4e2a158b9bc5033a2ece65708' 
  AND (
    token = 'bJhoFSQoxLDWS/WLU0HFAQCW+G0Q2R/Q8crCVXW+KOk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051