UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LK8X32O2JpREvW5yFtrk0LbxKHP2hl5cYWUTUzfoJRM=' 
WHERE 
  key_id = '47eb801353c864ae923aa4c5e09c80cdc0322651eee4422581fd7758cfc44384' 
  AND (
    token = 'LK8X32O2JpREvW5yFtrk0LbxKHP2hl5cYWUTUzfoJRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033