UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TcLYwLD/Mj9Z3HYLplnuuLBpPTC1s7sftu8/NfhK/bU=' 
WHERE 
  key_id = '75902d333b380814eae34523d2693efad2a3a5a3fbaf552ca4e6e3d9a3ed58d0' 
  AND (
    token = 'TcLYwLD/Mj9Z3HYLplnuuLBpPTC1s7sftu8/NfhK/bU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033